package com.greensam.pixelengine.pojo.entity;

import com.greensam.pixelengine.pojo.base.BaseEntity;
import com.greensam.pixelengine.pojo.emuns.StatusEnum;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Comment;

/**
 * @author Macro_Ray
 * @since 2025/6/19 14:48
 */
@Getter
@Setter
@Entity
@Table(name = "user_role_rel", indexes = {
        @Index(name = "idx_user_id", columnList = "user_id")
})
@Comment("用户-角色关系表")
public class UserRolePo extends BaseEntity {

    @Column(nullable = false, length = 20)
    @Comment("用户ID")
    private Long userId;

    @Column(nullable = false, length = 20)
    @Comment("角色ID")
    private Long roleId;

    @Column(nullable = false)
    @Comment("状态")
    @Enumerated(value = EnumType.STRING)
    private StatusEnum status;
}
